Pod::Spec.new do |s|
  s.name             = "BCWebImageKit"
  s.version          = "1.0.0"
  s.summary          = "iOS image库"
  s.description      = <<-DESC.gsub(/^\s*\|?/,'')
                       An optional longer description of Huihui Health

                       | * Markdown format.
                       | * Don't worry about the indent, we strip it!
                       DESC
  s.homepage         = "https://gitlab.leke.cn/health-huihui/app/ios/ios-component/BCWebImageKit.git"
  # s.screenshots     = "www.example.com/screenshots_1", "www.example.com/screenshots_2"
  s.license          = 'BSD'
  s.author           = { "chasel" => "chenchun1@cnstrong.cn" }
  s.source           = { :git => "git@gitlab.leke.cn:health-huihui/app/ios/ios-component/BCWebImageKit.git", :branch => "master" }

  s.platform     = :ios, '9.0'
  s.requires_arc = true

  s.default_subspec = 'Core'
  
  # SDWebImage 内嵌SDK，对应 git >5.10.0
  s.subspec 'SDWebImage' do |sd|
      sd.public_header_files = 'SDWebImage/Core/*.h', 'SDWebImage/WebImage/SDWebImage.h'
      sd.private_header_files = 'SDWebImage/Private/*.h'

      sd.source_files = 'SDWebImage/Core/*.{h,m}', 'SDWebImage/WebImage/SDWebImage.h', 'SDWebImage/Private/*.{h,m}'
      sd.pod_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) SDWEBIMAGE_INNER', 'SWIFT_ACTIVE_COMPILATION_CONDITIONS' => '$(inherited) SDWEBIMAGE_INNER'}
      sd.framework = 'ImageIO'
  end
  
  # 核心下载模块,内嵌集成 SDWebImage 子模块
  s.subspec 'Core' do |core|
        core.public_header_files = 'Core/**/*.h'
        core.source_files = 'Core/**/*.{h,m}'
        core.dependency 'BCWebImageKit/SDWebImage'
  end
  # 核心下载模块,单独集成 SDWebImage sdk
  s.subspec 'CoreNo' do |core|
      core.public_header_files = 'Core/**/*.h'
      core.source_files = 'Core/**/*.{h,m}'
      core.dependency 'SDWebImage'
  end
  
  # ui 扩展,内嵌集成 SDWebImage 子模块
  s.subspec 'UI' do |ui|
    ui.public_header_files = 'ImageView/**/*.h','Button/**/*.h'
    ui.source_files = 'ImageView/**/*.{h,m}','Button/**/*.{h,m}'

    ui.dependency 'BCFoundation'
    ui.dependency 'BCWebImageKit/SDWebImage'
  end
  # ImageView 扩展,单独集成 SDWebImage sdk
  s.subspec 'UINo' do |ui|
    ui.public_header_files = 'ImageView/**/*.h','Button/**/*.h'
    ui.source_files = 'ImageView/**/*.{h,m}','Button/**/*.{h,m}'
    ui.dependency 'BCFoundation'
    ui.dependency 'SDWebImage'
  end
  
    # ui 扩展,内嵌集成 SDWebImage 子模块
  s.subspec 'UISwift' do |ui|
    ui.source_files = 'Swift/**/*.swift'

    ui.dependency 'BCFoundation'
    ui.dependency 'BCWebImageKit/SDWebImage'
  end

      # webp 支持  内嵌集成 SDWebImage，SDWebImageWebPCoder，WebP
  s.subspec 'Webp' do |webp|
    webp.public_header_files = 'SDWebp/SDWebImageWebPCoder/**/*.h'
    webp.source_files = 'SDWebp/SDWebImageWebPCoder/Classes/**/*', 'SDWebp/SDWebImageWebPCoder/Module/SDWebImageWebPCoder.h'
    webp.pod_target_xcconfig = {
      'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) SD_WEBP=1'
    }
    webp.dependency 'BCWebImageKit/SDWebImage'
    webp.ios.vendored_frameworks = 'SDWebp/WebpFramework/WebP.xcframework','SDWebp/WebpFramework/WebPDemux.xcframework','SDWebp/WebpFramework/WebPMux.xcframework'
  end

end
